﻿using Core.Queries;
using System;
namespace Core.IServices
{
    public interface IGenericWriterService<TId, TEntity, TDto, TQuery>
        where TEntity : Core.Domain.IBaseEntity<TId>
        where TDto : Core.Dtos.BaseDto<TId>
        where TQuery : Query<TEntity>
    {
        Core.Messages.Response<TId> Add(Core.Messages.Request<TDto> request);
        Core.Messages.Response<TId> Add(TDto dto, Func<TEntity, TEntity> setEntity);
        Core.Messages.Response Delete(TId id);
        Core.Messages.Response Edit(TId id, Core.Messages.Request<TDto> request);
        Core.Messages.Response Edit(TId id, TDto dto, Func<TEntity, TEntity> setEntity);
        void Initialize(Core.IRepository.IUnitOfWork unitOfWork, Core.IRepository.IRepository<TId, TEntity> repository);
    }
}